{% set foo = [1, 1, 2, 1] %}
{%- for item in foo -%}
{%- ifchanged item- %}
{{ deferred[item] }}
{%- endifchanged -%}
{% endfor%}
